﻿namespace ViaConvert.Xml
{
    using System.Collections.Generic;
    using System.IO;
    using System.Linq;
    using System.Text;

    public class Load
    {
        public static Model.Xml.AddressInfo Init(string FullPath)
        {
            Model.Xml.AddressInfo models = Read(FullPath);
            
            return models;

        }

        private static Model.Xml.AddressInfo Read(string FullPath)
        {
            Model.Xml.AddressInfo data = null;
            
            string strValues = File.ReadAllText(FullPath);
            
            byte[] byteData = Encoding.UTF8.GetBytes(strValues);
            
            MemoryStream memStream = new MemoryStream(byteData);
            
            data = Serializer.Deserialize(memStream);

            return data;

        }
    }
}
